home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / OVERLAY / OVRUMB12 / OVRTEST.PAS < prev    next >
Pascal/Delphi Source File  |  1994-09-15  |  1KB  |  47 lines

  1. {$A-,B-,D+,E-,F+,G-,I+,L+,N-,O+,P-,Q-,R+,S+,T+,V-,X-,Y+}
  2. {$M 16384,0,655360}
  3. program OvrTest;
  4.  
  5.      {Test Program for OvrUMB. Shows how to rellocate the overlay
  6.       buffer in upper memory}
  7.  
  8.  
  9. uses Overlay,OvrUMB,
  10.      Ovr1,Ovr2;
  11.  
  12. {$O Ovr1}{$O Ovr2}
  13. var l:longint;
  14.  
  15. begin
  16.   Writeln('--> Available memory   : ',MemAvail);
  17.   Writeln('--> Max. Available UMB : ',umb_MaxAvail);
  18.   OvrInit('OVRTEST.OVR');
  19.   Writeln('Relocation of overlay buffer in UMB');
  20.   OvrMovBufToUMB;
  21. { if umb_MaxAvail>OvrGetBuf then (* equivalent to the previous line*)
  22.     OvrSetBufUMB(umb_MaxAvail);}
  23.   if OvrResult=ovrNoMemory then
  24.     writeln('WARNING: Not enough upper memory to rellocate buffer');
  25.   if OvrResult=ovrError then
  26.     writeln('WARNING: You have done something wrong. The buffer has not been moved.');
  27.   Writeln('--> Available memory   : ',MemAvail);
  28.   Writeln('--> Max. Available UMB : ',umb_MaxAvail);
  29.   Writeln('Allocation of two string[255]');
  30.   New(Q1);
  31.   Q1^:='This is the value of Q1';
  32.   New(Q2);
  33.   Q2^:='This is the value of Q2';
  34.   Writeln('--> Available memory : ',MemAvail);
  35.   Writeln('Execution of Proc1');
  36.   Proc1;
  37.   Writeln('Execution of Proc2');
  38.   Proc2;
  39.   Writeln('Execution of Proc1');
  40.   Proc1;
  41.   Writeln('Execution of Proc2');
  42.   Proc2;
  43.   Writeln('--> Available memory   : ',MemAvail);
  44.   Writeln('****** END ***********');
  45. end.
  46.  
  47.